import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { IActivityUser, IPage } from "./types";

/* 查询童虎列表列表 */
export function getPageActivityUserAPI(
  queryParams?: IPage
): AxiosPromise<PageResult<IActivityUser[]>> {
  return request({
    url: "/activityUser/page",
    method: "get",
    params: queryParams,
  });
}

/* 根据id查询活动对象 */
export function queryIsParticipateAPI(
  activityId: number
): AxiosPromise<IActivityUser> {
  return request({
    url: `/activityUser/${activityId}/queryParticipate`,
    method: "get",
  });
}

/**
 * 添加活动
 *
 * @param activityId
 */
export function addActivityUserAPI(activityId: string) {
  return request({
    url: `/activityUser/${activityId}/add`,
    method: "get",
  });
}

/**
 * 删除活动
 *
 * @param ids
 */
export function deleteActivityUserAPI(ids: number) {
  return request({
    url: "/activityUser/" + ids,
    method: "delete",
  });
}
